/*******************************************************************************
 * Copyright (c) 2008 Sylvain Sicard.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Sylvain Sicard - initial API and implementation
 ******************************************************************************/
package fr.jade.fraclite.type;

import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.api.type.TypeFactory;

import fr.jade.fraclite.InitializationContext;
import fr.jade.fraclite.api.Controller;

/**
 * Provides a basic implementation of the {@link TypeFactory} interface.
 */
public class BasicTypeFactory  implements Controller, TypeFactory {

  public void initFcController(InitializationContext ic) throws InstantiationException {
  }
  
  public InterfaceType createFcItfType (
    final String name,
    final String signature,
    final boolean isClient,
    final boolean isOptional,
    final boolean isCollection) throws InstantiationException
  {
    return new BasicInterfaceType(
      name, signature, isClient, isOptional, isCollection);
  }

  public ComponentType createFcType (final InterfaceType[] interfaceTypes)
    throws InstantiationException
  {
    return new BasicComponentType(interfaceTypes);
  }

}
